{  11 February 2011. Individual Olympiad. Problem set: http://neerc.ifmo.ru/school/io/archive/20110211/problems-20110211-individual.pdf
	Problem B
	Points: 100
}
uses SysUtils;
var n:integer;
begin
reset(input,'smooth.in');
rewrite(output,'smooth.out');
readln(n);
if n=1 then writeln(9) else
if n=2 then writeln(99) else
if n=3 then writeln(989) else
if n=4 then writeln(9889) else
if n=5 then writeln(97679) else
if n=6 then writeln(976679) else
if n=7 then writeln(9643469) else
if n=8 then writeln(96433469) else writeln(-1);
end.
